package cn.xshi.sys.init;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
 * 初始化平台数据至缓存中
 * @author 邓纯杰
 *
 */
@Component
@Slf4j
@Order(0)
public class InitSysData implements CommandLineRunner {

	@Resource
	GlobalPersistentComponent globalPersistentComponent;

	/**
	 *
	 * @param args
	 * @throws Exception
	 */
	@Override
	public void run(String... args) throws Exception {
		try {
			globalPersistentComponent.initSysDataDictionary();
			globalPersistentComponent.initSysAreaRegion();
			globalPersistentComponent.initPath();
			globalPersistentComponent.initSysIpFrozen();
			globalPersistentComponent.initSysConstant();
		} catch (Exception e) {
			log.error("加载异常：{}",e);
		}
	}
}
